<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户新增</title>
    <link  rel="stylesheet" type="text/css" href="css/font.css">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>

<div>
    姓名<input type="text" name="name"><br>
    真实姓名<input type="text" name="trueName"><br>
    卡id<input type="text" name="cardId"><br>
    Email<input type="text" name="email"><br>
    电话<input type="text" name="telephone"><br>
    QQ帐号<input type="text" name="qqId"><br>
    密码<input type="text" name="pwd"><br>
    问题<input type="text" name="question"><br>
    答案<input type="text" name="answer"><br>
    状态<input type="text" name="state">
</div>
<button id="div" >新增</button>
<script src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#div").click(function () {
            var name = $("[name='name']").val();
            var trueName = $("[name='trueName']").val();
            var cardId = $("[name='cardId']").val();
            var email = $("[name='email']").val();
            var telephone = $("[name='telephone']").val();
            var qqId = $("[name='qqId']").val();
            var pwd = $("[name='pwd']").val();
            var question = $("[name='question']").val();
            var answer = $("[name='answer']").val();
            var state = $("[name='state']").val();
            $.ajax({
                type:"post",
                url:"http://localhost:8080/untitled2_Web_exploded/adduser",
                data:{"name":name,"trueName":trueName,"cardId":cardId,"email":email,"telephone":telephone,"qqId":qqId,"pwd":pwd,"question":question,"answer":answer,"state":state},
                success:function (res) {
                    if(res.code==1){
                        alert(res.message)
                    }else {
                        alert(res.message)
                    }
                }
            })
        })
    })
</script>
</body>
</html>